package com.twu.biblioteca.representation;

import java.util.ArrayList;
import java.util.Scanner;

public abstract class Menu {
    private final static String MENU_HINT_INFO = "Please select the valid menu number!";
    private Scanner sc;
    private String inputStr;
    protected ArrayList<String> validOptions;

    public Menu() {
        this.sc=new Scanner(System.in);
    }
    public abstract String showMenu();

    public void inputOption() {
           inputStr=sc.nextLine();
    }
    public boolean isOptionValid() {
        if(validOptions.contains(inputStr)) {
            return true;
        }
        else  {
            System.out.println(MENU_HINT_INFO);
            return false;
        }
    }
    public String getOptionStr() {
        return inputStr;
    }
    public void setInputStr(String inputStr) {
        this.inputStr = inputStr;
    }

}
